import { ca, tr } from 'element-plus/es/locale/index.mjs';
import request from '../request.js';
//导入axios


// **分页查询固定题库**
export async function fetchFixedQuestions({page, size}) {
    try {
        const response = await request.get(`/generation/fixed/list`, {
            page,
            size,
        });
        return response;
    }catch (error) {
        return { total: 0, items: [] }; // 发生错误时返回空数据
    }
    
  }
  
  // **分页查询大模型题库**
  export async function fetchLlmQuestions({page, size}) {
    try {
        const response = await request.get(`/generation/llm/list`, {
            page,
            size,
        });
        return response;
    }catch (error) {
        return { total: 0, items: [] }; //
  }
}
  
  // **生成固定题库**
  export async function generateFixedQuestions({qt, choiceCount, trueFalseCount, shortAnswerCount}) {
    return await request.get(`/generation/fixed`, {
        choiceCount,
        trueFalseCount,
        shortAnswerCount
      });
  }
  
  // **生成大模型题库**
  export async function generateLlmQuestions({qt, choiceCount, trueFalseCount, shortAnswerCount, prompt}) {
    return await request.get(`/generation/llm`, {
        choiceCount,
        trueFalseCount,
        shortAnswerCount,
        prompt
    })
    
  }

  //发送请求合并题库
  export async function mergeQuestions() {
      return await request.get(`/generation/merge`)
  }
  